#include "student.h"
#include "oo_macro.h"

#include <stdio.h>
#include <stdlib.h>


static uint8_t student_introduce(const Person *parent, char *result) {
    Student* self = container_of(parent, Student, __Person);
	snprintf(result, MAX_INTRODUCE_LENGTH, "My name is %s. I am %d years old. I am a student of class %d.", parent->name, self->__Person.age, self->klass);
    return FUNCTION_SUCCESS_CODE;
};

void Student_Init(Student* self, uint8_t age, char* name, uint8_t klass) {
	Person_Init(&self->__Person, age, name);
    self->__Person.Introduce = student_introduce;
    self->klass = klass;
}
